import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 教练授课场地信息 */
export interface CoachVenue {
          id: number; // ID
          coachId?: number; // 教练ID
          venueId?: number; // 场地ID
          venueName?: string; // 场地名称
          cityId?: number; // 城市ID
          cityName?: string; // 服务城市名称
  }

// 教练授课场地 API
export const CoachVenueApi = {
  // 查询教练授课场地分页
  getCoachVenuePage: async (params: any) => {
    return await request.get({ url: `/business/coach-venue/page`, params })
  },

  // 查询教练授课场地详情
  getCoachVenue: async (id: number) => {
    return await request.get({ url: `/business/coach-venue/get?id=` + id })
  },

  // 新增教练授课场地
  createCoachVenue: async (data: CoachVenue) => {
    return await request.post({ url: `/business/coach-venue/create`, data })
  },

  // 修改教练授课场地
  updateCoachVenue: async (data: CoachVenue) => {
    return await request.put({ url: `/business/coach-venue/update`, data })
  },

  // 删除教练授课场地
  deleteCoachVenue: async (id: number) => {
    return await request.delete({ url: `/business/coach-venue/delete?id=` + id })
  },

  /** 批量删除教练授课场地 */
  deleteCoachVenueList: async (ids: number[]) => {
    return await request.delete({ url: `/business/coach-venue/delete-list?ids=${ids.join(',')}` })
  },

  // 导出教练授课场地 Excel
  exportCoachVenue: async (params) => {
    return await request.download({ url: `/business/coach-venue/export-excel`, params })
  },
}